Book Contents

Insert a string variable

Use the String Variable dialog box to enter a string variable in a text box. The string variable can be a tag name or placeholder that will change dynamically at run time, or a literal string that will be shown as entered here.

There are instances where you may want to embed string data within another string. For example, you may be connected to a controller that provides alarm text messages or event messages through a tag or data item. You may want to trap that text message and save it in a FactoryTalk View alarm message, to retain a history of controller issues. To do this, embed the data item within the alarm message text generated when the alarm is triggered. When the alarm occurs, the variable string is saved with the alarm text.

Tip:

Embedded variables are case sensitive, and must be in the proper format and syntax to work. If you make a mistake, your variable will be treated as a piece of text. Therefore, do not attempt to edit embedded variables manually. Use the Insert Variable and Edit variable dialog boxes to avoid problems.

To insert a string variable

  1. In the Caption box in a graphic object’s Properties dialog box, or in the Message column of the Local Messages, Information Messages, or Alarm Setup editor, click Insert Variable.
  2. Click String.
  3. Specify the options in the dialog box that opens and click OK.

To edit a String variable

  1. Double-click the string variable in the text box, or right-click and select Edit Variable.
  2. In the String Variable dialog box, make the required changes and click OK.

Options

  • Tag

    Choose this option to use a string tag as the source of the string variable. Type the name of a string tag, or type a tag placeholder.

    To open the Tag Browser and select a tag, click the Browse button.

  • Literal string

    Choose this option to enter a literal character string as the string variable. This choice places the character 'L' (for Literal) at the beginning of the embedded variable, and prevents the system from performing a tag read for this variable.

    Tip:

    You can include numbers in the Literal string option. However, if the number you want to show requires decimal places or other special formatting, use the Literal number option.

  • Fixed number of characters

    Check this box if you want the variable to always display the same number of characters. Then select the number of characters to display, up to 255.

    If you clear this box, the length of the embedded variable changes to accommodate the length of the string tag’s value.

    • Right-most characters in string are shown

      Check this box if you want the number of shown characters to be counted from the right-hand side of the string, instead of the left-hand side.

    • Show * character if string is longer than field width

      Check this box if you want the display to show an asterisk (*) if the character string is too long to be shown in the field. If the Right-most characters in string are displayed check box is selected, the asterisk will appear at the beginning of the string, otherwise it will appear at the end.

See also

About embedded variables

String variable syntax

Insert a numeric variable

Insert a time/date variable